package com.gitee.cui.springcloud.storage.service.impl;

import javax.annotation.Resource;

import com.gitee.cui.springcloud.storage.dao.StorageDao;
import com.gitee.cui.springcloud.storage.service.StorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022-03-26 15:23
 **/
@Service
@Slf4j
public class StorageServiceImpl implements StorageService {

	@Resource
	private StorageDao storageDao;

	@Override
	public void decrease(Long productId, Integer count) {
		log.info("-------->开始扣库存，扣除数量：{}", count);
		storageDao.update(productId, count);
		log.info("-------->扣库存end");
	}
}
